﻿#include "CGameEngine.h"

//消息处理函数
CGameEngine GameEngine;
BOOL CALLBACK Proc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
	//要分隔的状态栏
	int nPanels[4] = {200, 500, 600, -1};

	switch(uMsg)
	{
	case WM_SHOWWINDOW:

		//创建状态栏
		GameEngine.StatusBar.Create(WS_CHILD | WS_VISIBLE, _T(""), GameEngine.m_Win.GetHandle(), NULL);
		GameEngine.StatusBar.AddPanel(4, nPanels);

		//加载模块
		GameEngine.LoadLibs();

		return TRUE;
	case WM_INITDIALOG:
		return TRUE;
	case WM_PAINT:
		//设置背景颜色
		GameEngine.SetBkColor(RGB(0, 0, 0));

		return TRUE;
	case WM_SIZE:
		GameEngine.StatusBar.Resize();
		return TRUE;
	case WM_COMMAND:
		GameEngine.MenuCommand(LOWORD(wParam));
		return TRUE;

	case WM_CLOSE:
		PostQuitMessage(0);
		return TRUE;
	}

	return FALSE;
}